package com.cms.persist;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.cms.model.Page;

public class DaoHelper implements Dao
{
	public List<Page> getAllPages()
	{
		PersistenceManager pm = PMF.get().getPersistenceManager();
		List <Page> result = new ArrayList<Page>();
		Query query = pm.newQuery(Page.class);
		try
		{
			result = (List<Page>)query.execute();
		}
		finally 
		{
			query.closeAll();
			pm.close();
		}
		return result;
	}

	@Override
	public Page getPageById(long id) 
	{
		// TODO Auto-generated method stub
		return null;
	}
}
